﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using YArchitech.Controls;
using YArchitech.DataModel;

namespace YArchitech.HVAC
{
	public partial class DuctAlignmentWallForm : System.Windows.Forms.Form
	{
		public DuctAlignmentWallForm()
		{
			this.InitializeComponent();
		}

		private void btnOk_Click(object sender, EventArgs e)
		{
			try
			{
				this.width = Convert.ToDouble(this.txtWidth.Text.Trim());
				this.userSetting.WriteValue("ductalignwall", "width", this.txtWidth.Text.Trim());
			}
			catch (Exception)
			{
				this.width = 0.0;
			}
			base.DialogResult = DialogResult.OK;
		}

		private void btnCancel_Click(object sender, EventArgs e)
		{
			base.DialogResult = DialogResult.Cancel;
		}

		private void DuctAlignmentWallForm_Load(object sender, EventArgs e)
		{
			this.txtWidth.Text = this.userSetting.GetValue("ductalignwall", "width");
		}

		private UserSetting userSetting = new UserSetting();

		public double width;
	}
}
